<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/confirm.css">
  <script src="../libs/requirejs/require.min.js" data-main="../js/confirm"></script>
</head>
<body>
    <a href="../index.html"><div class="logo"></div></a>
  <table border="1">
    <thead>
      <tr>
        
        <th class="text2">商品图片</th>
        <th class="text3">商品标题</th>
        <th class="text4">商品价格</th>
        <th class="text5">选购数量</th>
        <th class="text6">小计</th>
      </tr>
    </thead>
    <tbody class="cart-body">
      
    </tbody>
    <tfoot>
      <tr>
        <td colspan="6" >
            <div class="head">
                <div class="line">
                    <div class="total price"></div>
                    <div class="explain">商品总金额 ( 不含运费 ) : ￥</div>
                </div>
                <div class="line">
                    <div class="price">15</div>
                    <div class="explain">运费  : ￥</div>
                </div>
                <div class="line">
                    <div class="price">0</div>
                    <div class="explain">优惠券  : ￥</div>
                </div>
                <div class="line">
                    <div class="total1 price"></div>
                    <div class="explain">总计  : ￥</div>
                </div>
                
            </div>


          <div class="foot">
            
            <a href="cart.html"><div class="bt1">确认，提交订单</div></a>
            <a href="cart.html"><div class="bt">返回购物车</div></a>
          </div>
        </td>
      </tr>
    </tfoot>
  </table> 

  <!-- 定义购物车中商品行的模板 -->
  <script type="text/html" id="cart-template">
    {{if confirm.length === 0}}
      <tr>
        <td colspan="4">购物车为空，请<a href="/">选购商品</a></td>
      </tr>
    {{else}}
      {{each confirm}}
      <tr data-id="{{$value.id}}">
        
        <td class="text2"><img src="{{$value.image}}" style="width: 64px; height: 64px;"></td>
        <td class="text3">{{$value.title}}</td>
        <td class="text4">{{$value.price}}</td>
        <td class="text5">
          <div class="min-plus">
            <span class="amount">{{$value.amount}}</span>
          </div>
        </td>
        <td class="sub text6">{{$value.price * $value.amount}}</td>
      </tr>
      {{/each}}
    {{/if}}
  </script>
</body>
</html>